<?php
    class Default_Form_ValidateUser
    {
        public function validateEmail($email) {
            $validate = new Zend_Validate_StringLength(1, 100);
            if($validate->isValid($email)) {
                $validate = new Zend_Validate_EmailAddress();
                if($validate->isValid($email)) {
                    return true;
                }
                else {
                    return false;
                }
            }
            else {
                return false;
            }
        }
        
        public function validateFullname($fullname) {
            $validate = new Zend_Validate_StringLength(5, 50);
            if($validate->isValid($fullname)) {
                $validate = new Zend_Validate_Alpha(true);
                if($validate->isValid($fullname)) {
                    return true;
                }
                else {
                    return false;
                }
            }
            else {
                return false;
            }
        }
        
        public function validatePassword($password) {
            $validate = new Zend_Validate_StringLength(6, 32);
            if($validate->isValid($password)) {
                return true;
            }
            else {
                return false;
            }
        }
    }

